#ifndef COMMON_MISC_H
#define COMMON_MISC_H

#include <cmath>

static const float PI = 3.1415926535897932384626433832795f; // Oh fuck...
static const float EPSILON = 1E-7f;

typedef unsigned int uint;

inline float ToDegrees( float radian ) {
	return radian * 180 / PI;
}

inline float ToRadians( float degree ) {
	return degree * PI / 180;
}

inline bool FloatEq( float a, float b ) {
	return fabs( a - b ) <= EPSILON;
}

inline float Det2( float a11, float a12, float a21, float a22 ) {
	return a11 * a22 - a12*a21;
}
#endif
